<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ page import="java.io.*, java.sql.*, java.util.*,LS.*"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%request.setCharacterEncoding("utf-8"); %>
<!DOCTYPE html>
<html lang="UTF-8">
<style>
.b:hover {
	background-color: black;
	color: white;
	cursor: pointer;
}
body,table,tr,td,select,input,div,form,textarea,font{font-family:Mond; font-size=12pt; } 
th,td {
	padding-bottom: 5px;
	padding-top: 5px;
}

h4 {
	margin: 0px;
	padding: 0px;
}

table {
	margin: 10px;
	width: 100%;
}

#headerdiv {
	margin-bottom: 50px;
	color: #000;
}

#gongjitab {
	padding-left: 10px;
}

#gongjiview,#equiplistview,#q {
	/*         padding: 19px 29px 29px; */
	/*         margin: 0 auto 20px; */
	margin-left: 0px;
	text-align: center;
	background-color: #fff;
	border: 1px solid #e5e5e5;
	-webkit-border-radius: 5px;
	-moz-border-radius: 5px;
	border-radius: 5px;
	-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
	-moz-box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
	box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}

#gongjiview {
	padding: 10px 10px 10px 10px;
	height: 197px;
}


#q {
	padding: 10px 10px 10px 10px;
	min-height: 197px;
}

#equiplistview {
	padding-top: 20px;
	padding-bottom: 17px;
}
</style>

<head>
<meta charset="utf-8">
<title>성공회대학교 기자재 대여 시스템</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<!-- styles시트 -->
<link href="/LSsystem/assets/css/bootstrap.css" rel="stylesheet">
<link href="/LSsystem/assets/css/bootstrap-responsive.css" rel="stylesheet">
<link href="/LSsystem/assets/css/docs.css" rel="stylesheet">
<script type="text/javascript" src="/LSsystem/assets/js/bootstrap.js"></script>
<script type="text/javascript"
	src="http://code.jquery.com/jquery-1.7.min.js"></script>
<script type="text/javascript" src="/LSsystem/assets/smartPop/jquery.smartPop.js"></script>
<link rel="stylesheet" href="/LSsystem/assets/smartPop/jquery.smartPop.css" />

<script type="text/javascript">

		$(document).ready(function() {
			$('.dropdown-toggle').dropdown();
			$('#r').click(function() {
				
				if($('#e_id').val().trim() == "") {
					alert("일련번호를 입력하세요.");
				} else {

					e_id = $('#e_id').val();
					$.smartPop.open({
						width : 700,
						height : 190,
						url : 'returnSuccessaa.do?id='+e_id
					});
					
				}
				
			});
			
			$('.a').click(function() {
				lending = $(this).attr('id');
				$.smartPop.open({
					width : 900,
					height : 645,
					url : 'aproveSmartPop.do?lending='+lending
				});
			});
			
			$('#l').click(function() {
				id = $('#s_id').val();
				$.smartPop.open({
					width : 700,
					height : 190,
					url : 'indexAproveSmartPop.do?id='+id
				});
			});
		});
		
		function smartPopClose() {
			$.smartPop.close();
		}
</script>

<script src="/LSsystem/assets/js/jquery.js"></script>

</head>

<body data-spy="scroll" data-target=".bs-docs-sidebar">
	<!-- 메뉴
    ================================================== -->
	<%if(session.getAttribute("user")==null) {%>
	<jsp:include page="/top.do"></jsp:include>
	<%}else{
	    	Users u = (Users)session.getAttribute("user");%>
	<!-- 관리자가 로그인 했을 경우 메뉴 -->
	<jsp:include page="/managertop.do"></jsp:include>
	<%}%>
	<!-- Header
    ================================================== -->

	<div style="text-align: center">
		<div class="marketing" id="headerdiv">
			<h1>
				<strong>기자재 대여 시스템</strong><b style="font-size: 20px;">&nbsp;&nbsp;from.
					SKHU</b>
			</h1>
		</div>
		<form class="form-inline" id="searchform">
<!-- 			<input type="text" class="input-middle" size=20> -->
<!-- 			<button type="submit" class="btn" id="search">검색</button> -->
		</form>
	</div>
	<div class="container">
		<div style="height: 30px;"></div>
	</div>

	<!-- 메인
    ================================================== -->
	<div class="container">
		<div class="row-fluid" style="margin-bottom: 20px;">
			<div style="width: 100%; text-align: center;">
				<div class="span6" style="margin: 1px 1px 1px 1px; float: left">
					<div id="gongjitab">
						<h4>실제 대여 확인</h4>
					</div>
					<div id="gongjiview">
						<br><br><br>
						<b>대여 승인 완료된 학생의 학번 입력</b><br>
						<input type="text" id="s_id" class="input-middle" style="margin:3px;">
						<button id="l" class="btn" style="margin:0px;">대여 하기</button>
					</div>
				</div>
				<div class="span6" style="margin: 1px 0px 1px 1px; float: right;">
					<div id="gongjitab">
						<h4>반납 확인</h4>
					</div>
					<div id="gongjiview">
							<br><br><br>
							<b>반납 할 기자재의 일련번호를 입력</b><br>
							<input type="text" id="e_id" class="input-middle" style="margin:3px;">
							<button id="r" class="btn" style="margin:0px;">반납 하기</button>
					</div>
				</div>
			</div>
		</div>
		<div class="row-fluid" style="text-align: center;">
			<div style="width: 100%; text-align: center;">
				<div class="span12" style="margin: 1px 1px 1px 1px;">
					<div id="gongjitab">
						<h4>대여 신청 승인</h4>
					</div>
					<div id="gongjiview" style="padding-right:30px;">
						<table style="border-bottom: 1px solid #e5e5e5;border-top: 1px solid #e5e5e5;">
						<c:forEach var="list" items="${aprovelist}">
							<tr class="b" id="${list.lending_id }">
								<td class="a" id="${list.lending_id }">
								<c:if test="${list.lending_R_E == 'L'}"> 대여</c:if>
								<c:if test="${list.lending_R_E == 'E'}"> 연장</c:if>
								<c:if test="${list.lending_R_E == 'R'}"> 예약</c:if>
								</td>
								<td class="a" id="${list.lending_id }">
								<c:if test="${list.user_position == 'S' }">학생</c:if>
								<c:if test="${list.user_position == 'F' }">수업담당교수</c:if>
								<c:if test="${list.user_position == 'P' }">재직교수</c:if>
								<c:if test="${list.user_position == 'T' }">학과장</c:if>
								</td>
								<td class="a" id="${list.lending_id }">${list.name }</td>
								<td class="a" id="${list.lending_id }">${list.user_id }</td>
								<td class="a" id="${list.lending_id }">${list.departments_name }</td>
								<td class="a" id="${list.lending_id }">${list.item_name }</td>
								<td class="a" id="${list.lending_id }">${list.model_name }</td>
							</tr>
						</c:forEach>
						</table>
						<a href="aprove.do" style="float: left; margin-left:20px;">전체 보기</a><b style="font-size: 12px; color: red;">(대여 신청 접수의 개수는 총${count }건)</b>
					</div>
					
					<div id="gongjitab">
						<h4>반납 예정일이 지난 대여자</h4>
					</div>	
					<div id="q" style="padding-right:30px;">
						<table class="tableview">
						<tr>
							<th>학번(사번)</th>
							<th>이름</th>
							<th>품목명</th>
							<th>모델명</th>
							<th>일련번호</th>
							<th>반납 예정일</th>
							<th>연체 기간</th>
						</tr>
						
						<c:forEach var="s" items="${selectOverdue}">
							<tr class="selectTableItem" id=sample2>
								<td>${s.user_id}</td>
								<td>${s.name}</td>
								<td>${s.item_name}</td>
								<td>${s.model_name}</td>
								<td>${s.equipment_id}</td>
								<td><fmt:formatDate pattern="yyyy년 MM월 dd일" value="${s.due_date}"/></td>
								
								<td style="color:red">${s.overdue} 일</td>
							</tr>
						</c:forEach>
						
					</table>
					</div>
				</div>
			</div>
		</div>
	</div>



	<!-- 꼬리말
    ================================================== -->
	<footer class="footer">
		<div class="container">
			<p>Copyright SKHU. Software Student.</p>
		</div>
	</footer>


	<!-- javascript -->
	<script type="text/javascript"
		src="http://platform.twitter.com/widgets.js"></script>
	<script src="/LSsystem/assets/js/bootstrap-transition.js"></script>
	<script src="/LSsystem/assets/js/bootstrap-alert.js"></script>
	<script src="/LSsystem/assets/js/bootstrap-modal.js"></script>
	<script src="/LSsystem/assets/js/bootstrap-dropdown.js"></script>
	<script src="/LSsystem/assets/js/bootstrap-scrollspy.js"></script>
	<script src="/LSsystem/assets/js/bootstrap-tab.js"></script>
	<script src="/LSsystem/assets/js/bootstrap-tooltip.js"></script>
	<script src="/LSsystem/assets/js/bootstrap-popover.js"></script>
	<script src="/LSsystem/assets/js/bootstrap-button.js"></script>
	<script src="/LSsystem/assets/js/bootstrap-collapse.js"></script>
	<script src="/LSsystem/assets/js/bootstrap-carousel.js"></script>
	<script src="/LSsystem/assets/js/bootstrap-typeahead.js"></script>
	<script src="/LSsystem/assets/js/bootstrap-affix.js"></script>

	<script src="/LSsystem/assets/js/holder/holder.js"></script>
	<script src="/LSsystem/assets/js/google-code-prettify/prettify.js"></script>

	<script src="/LSsystem/assets/js/application.js"></script>
</body>
</html>
